package thinkinginjava.generics;
import java.util.List;
import java.util.ArrayList;

public class GenericVerargs {
	
	public static <T> List<T> makeList(T... args) {
		List<T> list = new ArrayList<T>();
		for (T t : args) {
			list.add(t);
		}
		return list;
	}
	
	//test
	public static void main(String[] args) {
		List<String> ls = makeList("A");
		System.out.println(ls);
		
		ls  = makeList("A", "e", "c");
		System.out.println(ls);
		
		ls = makeList("faklsjfasljgslghlasf".split(""));
		System.out.println(ls);
	}
}
